home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Various / DevDisk 65 (1989)(DevWare PD).zip / DevDisk 65 (1989)(DevWare PD).adf / prosuite / alerts.c < prev    next >
C/C++ Source or Header  |  1990-07-11  |  3KB  |  101 lines

  1.  
  2. /* *** alerts.c *************************************************************
  3.  *
  4.  * Alert and Abort AutoRequest Routines
  5.  *     from Book 1 of the Amiga Programmers' Suite by RJ Mical
  6.  *
  7.  * Copyright (C) 1986, 1987, Robert J. Mical
  8.  * All Rights Reserved.
  9.  *
  10.  * Created for Amiga developers.
  11.  * Any or all of this code can be used in any program as long as this
  12.  * entire copyright notice is retained, ok?
  13.  *
  14.  * The Amiga Programmer's Suite Book 1 is copyrighted but freely distributable.
  15.  * All copyright notices and all file headers must be retained intact.
  16.  * The Amiga Programmer's Suite Book 1 may be compiled and assembled, and the 
  17.  * resultant object code may be included in any software product.  However, no 
  18.  * portion of the source listings or documentation of the Amiga Programmer's 
  19.  * Suite Book 1 may be distributed or sold for profit or in a for-profit 
  20.  * product without the written authorization of the author, RJ Mical.
  21.  * 
  22.  * HISTORY      NAME            DESCRIPTION
  23.  * -----------  --------------  --------------------------------------------
  24.  * 27 Sep 87    RJ              Removed reference to alerts.h, brought 
  25.  *                              declarations into this file
  26.  * 4 Feb 87     RJ              Real release
  27.  * 11 Jul 86    RJ >:-{)*       Prepare (clean house) for release
  28.  * 1 Feb 86     =RJ Mical=      Created this file with fond memories
  29.  *
  30.  * *********************************************************************** */
  31.  
  32.  
  33. #include <prosuite/prosuite.h>
  34.  
  35.  
  36. #define ALERT_TEXT_TOP   6
  37. #define ALERT_TEXT_LEFT  6
  38.  
  39.  
  40. extern struct TextAttr SafeFont;
  41.  
  42.  
  43. UBYTE *AlertStrings[] =
  44.     {
  45.     /*       "Longest allowed string -----------|" */
  46.     (UBYTE *)"Really broken.  Stop all and reboot",
  47.     (UBYTE *)"Out of memory!  Sheesh.",
  48.     (UBYTE *)"Invalid Disk or Drawer Selection",
  49.     };
  50.  
  51.  
  52. struct IntuiText AlertText =
  53.     {
  54.     AUTOFRONTPEN, AUTOBACKPEN, AUTODRAWMODE,
  55.     AUTOLEFTEDGE + ALERT_TEXT_LEFT, AUTOTOPEDGE + ALERT_TEXT_TOP,
  56.     &SafeFont,
  57.     NULL, NULL,
  58.     };
  59.  
  60.  
  61. struct IntuiText AlertOKText =
  62.     {
  63.     AUTOFRONTPEN, AUTOBACKPEN, AUTODRAWMODE,
  64.     AUTOLEFTEDGE, AUTOTOPEDGE,
  65.     &SafeFont,
  66.     (UBYTE *)"OK", 
  67.     NULL,
  68.     };
  69.  
  70.  
  71.  
  72. VOID AlertGrunt(text, window)
  73. UBYTE *text;
  74. struct Window *window;
  75. {
  76.     AlertText.IText = text;
  77.     AutoRequest(window, &AlertText, NULL, 
  78.             &AlertOKText, 0, 0, 320, 48 + ALERT_TEXT_TOP);
  79. }
  80.  
  81.  
  82.  
  83. VOID Alert(abortNumber, window)
  84. USHORT abortNumber;
  85. struct Window *window;
  86. {
  87.     AlertGrunt(AlertStrings[abortNumber], window);
  88. }
  89.  
  90.  
  91.  
  92. VOID Abort(abortNumber, window)
  93. USHORT abortNumber;
  94. struct Window *window;
  95. {
  96.     Alert(abortNumber, window);
  97. /*???    FOREVER Alert(ALERT_ABORT, window);*/
  98.     FOREVER Alert(0, window);
  99. }
  100.  
  101.